import { dayjs } from "element-plus";

const firstDayOfMonth = dayjs().startOf('month').format('YYYY-MM-DD');
const lastDayOfMonth = dayjs().endOf('month').format('YYYY-MM-DD');
//合同统计总览
export const originContractStatistics = [
  {
    title: "预估利润",
    num: "0",
    popoverText: "合同金额-预估成本",
    prefix:'￥',
    fieldParam:'estimateProfitAmount'
  },
  {
    title: "预估利润率",
    num: "0",
    suffix:'%',
    popoverText:'预估利润/预估合同收入',
    fieldParam:'estimateProfitRate'
  },
  {
    title: "合同收入",
    prefix:'￥',
    num: "0",
    popoverText: '合同金额之和',
    fieldParam:'totalAmount'
  },
  {
    title: "预估成本",
    num: "0",
    prefix:'￥',
    popoverText: '合同签约后的预算报价单，核量后的材料和人工成本之和',
    fieldParam:'estimateCostAmount'
  }
]

//已结算利润
export const originSettledProfit = [
  {
    title: "实际利润",
    num: "0",
    popoverText: "项目总收入-项目总成本",
    prefix:'￥',
    fieldParam:'actualProfitAmount'
  },
  {
    title: "实际利润率",
    num: "0",
    suffix:'%',
    popoverText: "实际利润/项目总收入",
    fieldParam:'actualProfitRate'
  }

]

//已结算收入明细
export const originSettledDetail = [
  {
    title: "项目总收入",
    num: "0",
    popoverText: "合同收入+增减项收入+其他收入",
    prefix:'￥',
    fieldParam:'totalProfitAmount',
    children:[
      {
        title: "合同收入",
        num: "0",
        popoverText: "合同签约后的预算报价单的已收款金额之和",
        prefix:'￥',
        fieldParam:'totalAmount'
      },
      {
        title: "增减项收入",
        num: "0",
        popoverText: "增减项单的已收款金额之和",
        prefix:'￥',
        fieldParam:'increaseAmount'
      },
      {
        title: "其他收入",
        num: "0",
        popoverText: "整改单的已收款金额之和+增减项和整改单的判责金额之和",
        prefix:'￥',
        fieldParam:'otherAmount'
      }

    ]
  },
  {
    title: "项目总成本",
    num: "0",
    prefix:'￥',
    popoverText: "合同成本+整改成本+其他成本",
    fieldParam:'totalCostAmount',
    children:[
      {
        title: "合同成本",
        num: "0",
        popoverText: "合同的材料和人工成本之和",
        prefix:'￥',
        fieldParam:'costAmount'
      },
      {
        title: "整改成本",
        num: "0",
        popoverText: "整改单的公司承担金额",
        prefix:'￥',
        fieldParam:'rectifyCostAmount'
      },
      {
        title: "其他成本",
        num: "0",
        popoverText: "合同关联的报销单金额之和、增减项单判责的公司承担金额之和的合计",
        prefix:'￥',
        fieldParam:'otherCostAmount'
      }

    ]
  }

]

//搜索条件
export const initFilterCondition= {
    contractTypeId: "",
    signingTime: [firstDayOfMonth,lastDayOfMonth],
    settlementTime: [],
    startSignDate: "",
    endSignDate: "",
    startSettleTime: "",
    endSettleTime: "",
    settleStatus: ""
}


// 工程状态
export  const engineeringStatusObj = {
  "not_start": {text:"未开始",color:"#909399",bgColor:'#e9e9eb'},
  "ing":{text:"进行中",color:"#409EFF",bgColor:'#D9EDFF'},
  "shutdown":{text:"已停工",color:"#f56c6c",bgColor:'#fde2e2'},
  "shutdown_ing":{text:"停工审核中",color:"#e6a23c",bgColor:'#faecd8'},
  "complete":{text:"已交付",color:"#14C85C",bgColor:'#E3F9E9'}
}
//结算状态
export const settlementStatusObj ={
  "not_settle":{text:"未结算",color:"#909399",bgColor:'#e9e9eb'},
  "wait_settle":{text:"待申请",color:"#409EFF",bgColor:'#D9EDFF'},
  "settle":{text:"已结算",color:"#14C85C",bgColor:'#E3F9E9'},
  "settle_ing":{text:"审批中",color:"#e6a23c",bgColor:'#faecd8'},
  "settle_not_pass":{text:"未通过",color:"#f56c6c",bgColor:'#fde2e2'}
}
